﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LimpaGaragem.BLL.Product
{
    public class Comment
    {
        /// <summary>
        /// Return list of comment
        /// </summary>
        /// <returns></returns>
        public List<LimpaGaragem.Model.Product.Comment> GetListOfComment(int IDProduct)
        {
            try
            {
                return new LimpaGaragem.DAO.Product.Comment().GetListOfComment(IDProduct);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Insert new comment
        /// </summary>
        public int InsertComment(int? IDCommentParent,
                                    int IDProduct,
                                    int IDUser,
                                    string Content)
        {
            try
            {
                return new LimpaGaragem.DAO.Product.Comment().InsertComment(IDCommentParent, IDProduct, IDUser, Content);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Delete comment
        /// </summary>
        public void DeleteComment(int IDComment)
        {
            try
            {
                new LimpaGaragem.DAO.Product.Comment().DeleteComment(IDComment);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
